package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.SaleServerCostRecordAddDTO;
import org.jsola.hr.dto.SaleServerCostRecordImportDTO;
import org.jsola.hr.dto.SaleServerCostRecordUpdateDTO;
import org.jsola.hr.query.SaleServerCostRecordQuery;
import org.jsola.hr.vo.ImportExcelResultListVO;
import org.jsola.hr.vo.SaleServerCostRecordListVO;
import org.jsola.hr.vo.SaleServerCostRecordVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 客户服务费记录
 *
 * @author zhr
 */
@Api(tags = "hr-客户服务费记录")
public interface ISaleServerCostRecordControllerAPI {

    /**
     * 新增客户服务费记录
     *
     * @param saleServerCostRecordAddDTO 客户服务费记录新增实体
     * @return 客户服务费记录展示对象
     */
    @ApiOperation(value = "新增客户服务费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordAddDTO", dataType = "SaleServerCostRecordAddDTO", value = "新增客户服务费记录", paramType = "body")
    })
    Result<SaleServerCostRecordVO> save(SaleServerCostRecordAddDTO saleServerCostRecordAddDTO);


    /**
     * 修改客户服务费记录
     *
     * @param saleServerCostRecordUpdateDTO 客户服务费记录
     * @return 更新数量
     */
    @ApiOperation(value = "修改客户服务费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordUpdateDTO", dataType = "SaleServerCostRecordUpdateDTO", value = "修改客户服务费记录", paramType = "body")
    })
    Result<Integer> update(SaleServerCostRecordUpdateDTO saleServerCostRecordUpdateDTO);


    /**
     * 删除单个客户服务费记录，彻底删除
     *
     * @param saleServerCostRecordId 客户服务费记录id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个客户服务费记录，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordId", dataType = "String", value = "客户服务费记录id", paramType = "path")
    })
    Result<Integer> delete(String saleServerCostRecordId);


    /**
     * 批量删除客户服务费记录，彻底删除
     *
     * @param saleServerCostRecordIds 客户服务费记录id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除客户服务费记录，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordIds", dataType = "String[]", value = "客户服务费记录id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] saleServerCostRecordIds);


    /**
     * 根据客户服务费记录id查询客户服务费记录详情
     *
     * @param saleServerCostRecordId 客户服务费记录id
     * @return 客户服务费记录详情
     */
    @ApiOperation(value = "根据客户服务费记录id查询客户服务费记录详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordId", dataType = "String", value = "客户服务费记录id", paramType = "path")
    })
    Result<SaleServerCostRecordVO> findById(String saleServerCostRecordId);


    /**
     * 查询客户服务费记录
     *
     * @param saleServerCostRecordQuery 客户服务费记录查询参数
     * @return page
     */
    @ApiOperation(value = "查询客户服务费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordQuery", dataType = "SaleServerCostRecordQuery", value = "客户服务费记录查询参数", paramType = "query")
    })
    Result<List<SaleServerCostRecordListVO>> listAll(SaleServerCostRecordQuery saleServerCostRecordQuery);


    /**
     * 分页查询客户服务费记录
     *
     * @param saleServerCostRecordQuery 客户服务费记录查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询客户服务费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "saleServerCostRecordQuery", dataType = "SaleServerCostRecordQuery", value = "客户服务费记录查询参数", paramType = "query")
    })
    Result<Page<SaleServerCostRecordListVO>> page(SaleServerCostRecordQuery saleServerCostRecordQuery);

    /**
     * 导入
     *
     * @param file 文件
     * @return 导入结果
     */
    @ApiOperation(value = "分页查询客户服务费记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", dataType = "MultipartFile", value = "文件", paramType = "query")
    })
    Result<ImportExcelResultListVO<SaleServerCostRecordImportDTO>> importIncrease(MultipartFile file);

    /**
     * 导入Excel覆盖原有数据
     *
     * @param importData 导入数据
     * @return 覆盖结果
     */
    @ApiOperation(value = "导入Excel覆盖原有数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "importData", dataType = "SaleServerCostRecordImportDTO", value = "覆盖参数", paramType = "body")
    })
    Result<String> overlaidData(List<SaleServerCostRecordImportDTO> importData);

    /**
     * 错误数据导出
     *
     * @param errorList 错误列表
     * @return Excel
     */
    @ApiOperation(value = "错误数据导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "errorList", dataType = "ImportExcelResultListVO", value = "错误列表", paramType = "body")
    })
    ResponseEntity<Resource> exportErrorList(ImportExcelResultListVO<SaleServerCostRecordImportDTO> errorList);
}

